/***************************************************************************//**
 * @file FDM/FDM_Manager.h
 * @author  Marek M. Cel <marekcel@mscsim.org>
 *
 * @section LICENSE
 *
 * Copyright (C) 2013 Marek M. Cel
 *
 * This file is part of MScSim. You can redistribute and modify it under
 * the terms of GNU General Public License as published by the Free Software
 * Foundation; either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 * for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.
 * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Further information about the GNU General Public License can also be found
 * on the world wide web at http://www.gnu.org.
 ******************************************************************************/
#ifndef FDM_MANAGER_H
#define FDM_MANAGER_H

////////////////////////////////////////////////////////////////////////////////

#include "FDM_DataInp.h"
#include "FDM_DataOut.h"

#include "FDM_Main.h"

////////////////////////////////////////////////////////////////////////////////

/** This is interface class for the FDM module. */
class FDM_Manager
{
public:

    /** Constructor. */
    FDM_Manager();

    /** Destructor. */
    virtual ~FDM_Manager();

    /**
     * Updates FDM.
     * @param dataInp FDM data input structure
     * @param dataOut FDM data output structure
     */
    void update( double timeStep, const FDM_DataInp &dataInp, FDM_DataOut &dataOut );

private:

    FDM_Main *m_fdm;

    MScSimPhase m_inpPhase;     ///< internal (modified) input phase
    MScSimPhase m_inpPhasePrev; ///< internal (modified) input phase (previous)

    MScSimState m_outState;     ///< internal output state
    MScSimState m_outStatePrev; ///< internal output state (previous)

    /** Using this constructor is forbidden. */
    FDM_Manager( const FDM_Manager & ) {}

    void determineInternalPhase( MScSimPhase inpPhase );
};

////////////////////////////////////////////////////////////////////////////////

#endif // FDM_MANAGER_H
